﻿using System.Collections.ObjectModel;
using System.Windows;

using SBPweb.PROvibe.Client.Library.Models;
using SBPweb.PROvibe.Shared.Library.Components;
using SBPweb.PROvibe.Shared.Library.Layout;

using SBPweb.RIA.Client.Contracts.Base;

namespace SBPweb.PROvibe.Client.Core.Models
{

    public class ConfigurationModel : ModelBase, IConfigurationModel
    {

        #region Fields

        internal ObservableCollection<ISuite> allSuites = new ObservableCollection<ISuite>();
        internal ObservableCollection<IModule> allModules = new ObservableCollection<IModule>();

        #endregion

        #region Constructor logic

        public ConfigurationModel()
        {
            AllSuites = new ReadOnlyObservableCollection<ISuite>(allSuites);
            AllModules = new ReadOnlyObservableCollection<IModule>(allModules);
        }

        #endregion

        #region Dependencies

        public static readonly DependencyProperty CurrentSuiteProperty = DependencyProperty.Register("CurrentSuite", typeof(ISuite), typeof(ConfigurationModel), null);

        #endregion

        #region Properties

        public ReadOnlyCollection<ISuite> AllSuites
        {
            get;
            private set;
        }

        public ReadOnlyCollection<IModule> AllModules
        {
            get;
            private set;
        }

        public ISuite CurrentSuite
        {
            get
            {
                return GetTypedValue<ISuite>(CurrentSuiteProperty);
            }
            set
            {
                SetTypedValue<ISuite>(CurrentSuiteProperty, value, "CurrentSuite");
            }
        }

        #endregion
        
    }

}